<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Thông tin shop</title>
		<link rel="stylesheet" href="../css/reset.css" type="text/css" />
		<link rel="stylesheet" href="../css/common.css" type="text/css" />
		<link rel="stylesheet" href="../css/seller.css" type="text/css" />
		<script src="../scripts/jquery-1.5.2.min.js"></script>
		<script src="../scripts/common.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				$("#btSua").bind("click", function()
				{
					var serverURL = "../BUS/xl_SuKien.php?MaSK=" + $("#idSuKien").attr("value") + "&Sua=1";
					$("#detail_content").load(serverURL);
				});
				
			});
			var xmlhttp;
	
			function GetXmlHttpObject()
			{
				if (window.XMLHttpRequest)
				{
					// code for IE7+, Firefox, Chrome, Opera, Safari
					return new XMLHttpRequest();
				}
				if (window.ActiveXObject)
				{
					// code for IE6, IE5
					return new ActiveXObject("Microsoft.XMLHTTP");
				}
				return null;
			}
			
			function Xoa()
			{
				xmlhttp = GetXmlHttpObject();
				if(xmlhttp == null)
				{
					alert("Browser do not support HTTP REQUEST");
					return;
				}
				if(confirm("Bạn có muốn xóa sự kiện này không ?"))
				{
					var IdSuKien = document.getElementById("idSuKien").value; 
					var url = "../BUS/xl_SuKien.php?MaSK=" + IdSuKien + "&Xoa=1";
					xmlhttp.onreadystatechange=Xoa_Change;
					xmlhttp.open("GET",url,true);
					xmlhttp.send("null");
				}
			}
			
			function Xoa_Change()
			{
				if (xmlhttp.readyState==4)
				{
					alert("Đã xóa thành công !");
					
					window.location="safsf";
				}
			}
			
		</script>
	</head>
	<body>
		<div id="page">
			<?php
				require("../DAO/DataHelper.php");
				require("../webconfig.php");
				include_once("../DAO/SuKien_DAO.php");
				require("../UserControl/header.php");
			?>

			<div id="content">
				<div id="shop-banner">
					<img src="../temp/shop-banner.jpg" />
				</div>
				<?php
					require("../UserControl_NguoiBan/MenuDanhMucChucNang.php");
				?>
				<div id="seller-shop-info" class="block layout-2col-col2">
					<div class="title">
					  <h3>Chi Tiết Sự Kiện</h3>
				  </div>
					<div id="detail_content" class="content">
                    <?php
						$SuKien = null;
						if(isset($_REQUEST["MaSK"]))
							$SuKien = SuKien::ChiTietSuKien($_REQUEST["MaSK"]);
						if($SuKien != null)
						{
					?>
					<table class="them-san-pham-table">                            
                      <tr>
                          <td class="label-col"><label>Tên sự kiện : </label></td>
                          <td><label style="font-weight:bold; color:#F00"><?php echo $SuKien->sk_ten; ?><label>
                          <input type="hidden" id="idSuKien" value="<?php echo $SuKien->sk_ma; ?>" />
                          </td>
                      </tr>
                      
                      </tr>
                      <tr>
                          <td class="label-col"><label>Ngày bắt đầu : </label></td>
                           <td><label ><?php echo $SuKien->sk_ngay_bat_dau; ?><label></td>
                      </tr>
                      <tr>
                          <td class="label-col"><label>Ngày kết thúc : </label></td>
                           <td><label ><?php echo $SuKien->sk_ngay_ket_thuc; ?><label></td>
                          
                      </tr>
                      
                      <tr>
                          <td class="label-col"><label>Mô tả sự kiện : </label></td>
                           <td><label ><?php echo $SuKien->sk_mo_ta; ?><label></td>
                          
                      </tr>
                          <td></td>								
                          <td>
                     
                           <img src="../images/Edit-Document-icon.png" style="cursor:pointer" id="btSua" />
                                <img src="../images/delete-icon1.png" style="cursor:pointer" name="delete" id="btdelete" onclick="Xoa()" />
                      
                          </td>
                      </tr>
                </table>
						
                        
                    <?php
						}
					?>   
					</div>
				</div>
			</div>
			<?php
				require("../UserControl/footer.php");
			?>
		</div>
	</body>
</html>